using Fusion.Frameworks;
using UnityEngine;

namespace Fusion.Hotfix.Mono
{
    public class DLLMonoBase
    {
        protected string monoData;
        public DLLMonoBehaviour mono
        {
            get;
        }

        public bool enabled
        {
            get
            {
                return mono.enabled;
            }

            set
            {
                mono.Enable(value);
            }
        }

        public GameObject gameObject
        {
            get;
        }
        public Transform transform
        {
            get;
        }
        public DLLMonoBase()
        {
        }

        public DLLMonoBase(DLLMonoBehaviour mono, string monoData)
        {
            this.monoData = monoData;
            this.mono = mono;
            gameObject = mono.gameObject;
            transform = mono.transform;
        }

        public T GetComponent<T>()
        {
            return gameObject.GetComponent<T>();
        }

        public T GetComponentInChildren<T>(bool includeInactive = false)
        {
            return gameObject.GetComponentInChildren<T>(includeInactive);
        }

        public T GetOrAddComponent<T>() where T : Component
        {
            return gameObject.GetOrAddComponent<T>();
        }

        public T GetComponentInParent<T>(bool includeInactive = false)
        {
            return gameObject.GetComponentInParent<T>(includeInactive);
        }

        public T[] GetComponents<T>()
        {
            return gameObject.GetComponents<T>();
        }

        public T[] GetComponentsInChildren<T>(bool includeInactive = false)
        {
            return gameObject.GetComponentsInChildren<T>(includeInactive);
        }

        public T[] GetComponentsInParent<T>(bool includeInactive = false)
        {
            return gameObject.GetComponentsInParent<T>(includeInactive);
        }

        public bool TryGetComponent<T>(out T component)
        {
            return gameObject.TryGetComponent(out component);
        }

        public virtual void Awake()
        {

        }

        public virtual void Start()
        {

        }

        public virtual void OnEnable()
        {

        }

        public virtual void OnDisable()
        {

        }
    }
}

